<div>
    Set the git username / password credential for <strong>HTTP</strong> and <strong>HTTPS</strong> protocols.

<p>
<strong>Shell example</strong>
<pre>
withCredentials([gitUsernamePassword(credentialsId: 'my-credentials-id',
                 gitToolName: 'git-tool')]) {
  sh 'git fetch --all'
}
</pre>
</p>

<p>
<strong>Batch example</strong>
<pre>
withCredentials([gitUsernamePassword(credentialsId: 'my-credentials-id',
                 gitToolName: 'git-tool')]) {
  bat 'git submodule update --init --recursive'
}
</pre>
</p>

<p>
<strong>Powershell example</strong>
<pre>
withCredentials([gitUsernamePassword(credentialsId: 'my-credentials-id',
                 gitToolName: 'git-tool')]) {
  powershell 'git push'
}
</pre>
</p>

</div>
